<?php $this->load->view('header'); ?>
<?php $this->load->view('menus'); ?>

<br />
<form class="feedbackform" action="<?=site_url('task/create');?>" method="post">

<? if(isset($this->error)) { ?>
<div class="error">
	<?=$this->error?>
</div>
<? } ?>

<div class="fieldwrapper">
	<label for="title" class="styled">Begining Date:</label>
	<div class="thefield">
		<input class="date-pick" type="text" name="start_date"   />
	</div>
</div>
<div class="fieldwrapper">
	<label for="title" class="styled">Ending Date:</label>
	<div class="thefield">
		<input class="date-pick" type="text" name="end_date"   />
	</div>
</div>

<div class="fieldwrapper">
	<label for="description" class="styled">Project:</label>
	<div class="thefield">
	<select name="project_id">
		<? foreach( $this->Projects->fetch_all() as $project ) { ?>
		<option <? if( $this->project_id == $project->project_id ) {?>selected="selected"<?}?> 
			value="<?=$project->project_id?>"><?=$project->title?></option>
		<? } ?>
	</select>
</div>
</div>

<div class="fieldwrapper">
	<label for="title" class="styled">Title:</label>
	<div class="thefield">
		<input type="text" name="title"   />
	</div>
</div>

<div class="fieldwrapper">
	<label for="description" class="styled">Text:</label>
	<div class="thefield">
		<textarea name="description"></textarea>
</div>
</div>

<div class="buttonsdiv">
	<input type="submit" name="submit" value="Add task" style="margin-left: 150px;" /> 
	</div>

</form>


<?php $this->load->view('footer'); ?>
